<?php
class Login_Data_Registry {
	
	public $form;
	
	public function __construct(){
		$this->form = new Core_Driver_Firstform();
	}
	
	public function getData(){
		$data = array();
		$data['form'] = $this->createForm();
		return $data;
	}
	
	public function createForm(){
		
		$registryForm = $this->form->startForm(
			array(
			"id" => "registry",
					"name" => "registry",
					"method" => "post",
					"action" => SERVER_ROOT . "?login&page=registred"
		)
		);
		$registryForm .= REGISTER_FORM_MESSAGE;
		$registryForm .= "<ul>";
		$registryForm .= "<li>";
		$registryForm .= $this->form->labelForm(
			array(
			"for" => "realname"
		),
				REAL_NAME_OF_NEW_USER,
				null
		);
		$registryForm .= $this->form->inputForm(
			array(
			"type" => "text",
					"name" => "realname",
					"id" => "realname",
					"placeholder" => REAL_NAME_OF_NEW_USER_PLACEHOLDER,
					"maxlength" => "20"
		),
				"required autofocus",
				null
		);
		$registryForm .= "</li>";
		$registryForm .= "<li>";
		$registryForm .= $this->form->labelForm(
			array(
			"for" => "name"
		),
				USER_NAME_OF_NEW_USER,
				null
		);
		$registryForm .= $this->form->inputForm(
				array(
						"type" => "text",
						"name" => "name",
						"id" => "name",
						"placeholder" => USER_NAME_OF_NEW_USER_PLACEHOLDER,
						"maxlegth" => "20"
				),
				"required autofocus",
				null
		);
		$registryForm .= "</li>";
		$registryForm .= "<li>";
		$registryForm .= $this->form->labelForm(
				array(
						"for" => "language"
				),
				MANAGE_ACCOUNT_LANGUAGE,
				null
		);
		$registryForm .= $this->form->selectForm(
				array(
						"id" => "language",
						"name" => "language"
				),
				null,
				array(
						"pl" => "Polski",
						"en" => "English"
				)
		);
		$registryForm .= "</li>";
		$registryForm .= "<li>";
		$registryForm .= $this->form->labelForm(
				array(
						"for" => "email"
				),
				EMAIL_OF_NEW_USER,
				null
		);
		$registryForm .= $this->form->inputForm(
				array(
						"type" => "email",
						"name" => "email",
						"id" => "email",
						"placeholder" => EMAIL_OF_NEW_USER_PLACEHOLDER,
						"maxlegth" => "20"
				),
				"required autofocus",
				null
		);
		
		$registryForm .= "</li>";
		$registryForm .= "<li>";
		$registryForm .= $this->form->labelForm(
				array(
						"for" => "password"
				),
				PASSWORD_OF_NEW_USER,
				null
		);
		$registryForm .= $this->form->inputForm(
				array(
						"type" => "password",
						"name" => "password",
						"id" => "password",
						"placeholder" => PASSWORD_OF_NEW_USER_PLACEHOLDER,
						"maxlegth" => "20"
				),
				"required",
				null
		);
		$registryForm .= "</li>";
		$registryForm .= "<li>";
		$registryForm .= $this->form->labelForm(
				array(
						"for" => "password_two"
				),
				RETYPE_PASSWORD_OF_NEW_USER,
				null
		);
		$registryForm .= $this->form->inputForm(
				array(
						"type" => "password",
						"name" => "password_two",
						"id" => "password_two",
						"placeholder" => RETYPE_PASSWORD_OF_NEW_USER_PLACEHOLDER,
						"maxlegth" => "20"
				),
				"required",
				null
		);
		$registryForm .= "</li>";
		$registryForm .= "</ul>";
		$registryForm .= '<div class="buttons">';
		$registryForm .= $this->form->inputForm(
			array(
			"type" => "submit",
					"name" => "submt",
					"value" => REGISTER_BUTTON,
					"id" => "submit"
		),
				null
		);
		$registryForm .= "</div>";
		$registryForm .= $this->form->endForm();
		return $registryForm;
	}
	
}